/*
============================================================================
 Name        : BlockTenQuote.h
 Author      : \xD5\x{017c}\xD2\xE7\xE2
 Version     :
 Copyright   : Your copyright notice
 Description : \x{02ae}\xB5\xB5\xD0\xD0\xC7\xE9
============================================================================
*/

#ifndef BlockTenQuote_H
#define BlockTenQuote_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "BlockGoods.h"
#include "Field.h"
#include "Global.h"

// CLASS DECLARATION

/**
*  CBlockTenQuote
* 
*/
class CBlockTenQuote : public CBlockGoods
{
public:
	~CBlockTenQuote();

	static CBlockTenQuote* NewL(CBaseBlock* bsBack);

	static CBlockTenQuote* NewLC(CBaseBlock* bsBack);

	CBlockTenQuote(CBaseBlock* bsBack);

private:
	void ConstructL();

public:
	TBool ReadData(const TDesC8& aData);
	void WriteData(TDes8& aBuf);
	TInt GetDataLength();
	TInt16 GetDataType();
	void InitData();
	void OnDraw(CFbsBitGc& g) const;
	void OnKeyDown(TInt keyCode);
	void SizeChanged();
	void OnMouseUp(const TPoint& aPt);
	TBool OnMenuEvent(TInt menuId);

private:
	void DrawForm(CFbsBitGc& g, TRect aRect, TInt aMiddleLinePosX, CFont* aUseFont) const;
	void DrawTenQuote(CFbsBitGc& g, TRect aRect, TField& aField, CFont* aUseFont) const;
	void DrawDetial(CFbsBitGc& g, TRect aRect, TField& aField, CFont* aUseFont) const;
	TInt DrawFieldString(CFbsBitGc& g, TField& aField, TInt aID, TPoint aPos, CFont* aUseFont, TInt aAnchor = LEFT) const;
	TInt CalcMaxQuoteStringWidth(TField& aField, CFont* aUseFont, TInt aType) const;

protected:
	void AddTabs();

public: // from MTabbarObserver
	void HandleTabbarCommand(TInt aCommand);

private:
	TBool m_bIndexData;
	TBool m_bIndex;
	TInt m_psFieldID[38];
	TInt m_nBuyarray[50];
	TInt m_nSellarray[50];
	TInt m_nBuy1Count;
	TInt m_nSell1Count;
	CDesCArray* m_pstrTenQuote;
	TInt m_nDynamic;
	CFbsBitmap* m_buysell;
	CFbsBitmap* m_buysellMask;

	TInt m_QuoteClipRectStartPos;
	mutable TSize m_QuoteSize;
	
	mutable TInt iLeftPartWidth;
	mutable TInt iLeftMiddleLinePosX;
	mutable TInt iRightMiddleLinePosX;

	TBool iRequestOverTimeTip;
	HBufC* 	iStrOverTimeTip;
};

#endif // BlockTenQuote_H
